@using Microsoft.AspNetCore.Identity
@using VotingSystem.Models
@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager

<ul class="navbar-nav">
@if (SignInManager.IsSignedIn(User))
{
    <li class="nav-item">
        <a class="nav-link text-light" asp-controller="Account" asp-action="Profile">
            <i class="fas fa-user-circle"></i> @User.Identity?.Name
        </a>
    </li>
    <li class="nav-item">
        <form asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="form-inline">
            <button type="submit" class="btn btn-link nav-link text-light">
                <i class="fas fa-sign-out-alt"></i> 退出
            </button>
        </form>
    </li>
}
else
{
    <li class="nav-item">
        <a class="btn btn-light-outline me-2" asp-controller="Account" asp-action="Register">
            <i class="fas fa-user-plus"></i> 注册
        </a>
    </li>
    <li class="nav-item">
        <a class="btn btn-outline-light" asp-controller="Account" asp-action="Login">
            <i class="fas fa-sign-in-alt"></i> 登录
        </a>
    </li>
}
</ul> 